package com.zhaiweijia.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zhaiweijia.bean.Category;
import com.zhaiweijia.bean.Channel;
import com.zhaiweijia.dao.ChannelMapper;
import com.zhaiweijia.service.ChannelService;

@Service
public class ChannelServiceImpl implements ChannelService {

	@Autowired
	private ChannelMapper channelMapper;

	/**
	 * 查询所有的栏目数据
	 */
	@Override
	public List<Channel> getChannels() {
		return channelMapper.getChannels();
	}

	/**
	 * 根据栏目的id获取，该栏目下所有的分类
	 */
	@Override
	public List<Category> getCategoryByChannelId(Integer channelId) {
		return channelMapper.getCategoryByChannelId(channelId);
	}
}
